package com.cxyzy.demo.viewmodels

import androidx.lifecycle.ViewModel
import com.cxyzy.demo.db.repository.UserRepository
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

class UserViewModel internal constructor(private val userRepository: UserRepository) : ViewModel() {
    val userList = userRepository.getUserList()

    fun delUser(id: Int) {
        GlobalScope.launch {
            userRepository.delUser(id)
        }
    }
}